﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Comics.Extensions;
using Comics.Model;
using Comics.Providers;
using Comics.Services;


public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Cart _cart = new Cart();
        CartItem _item = new CartItem();

        _item.Quantity = 1;
        _item.Price = 15.00m;

        _cart.Items.Add(_item);

        Discount _discount1 = new Discount() { Type = Discount.DiscountType.DollarAmount, Amount = 1.25m };
        Discount _discount2 = new Discount() { Type = Discount.DiscountType.Percentage, Amount = .25m };

        //_cart.Discounts.Add(_discount1);
        _cart.Discounts.Add(_discount2);

        _cart.Taxes.Add(new Tax() { Amount = .07m, Name = "NC State Tax" });
        _cart.Shipping.Add(new Shipping() { Amount = 5m });

        this.subTotalLabel.Text = _cart.SubTotal.ToString();
        this.discountTotalLabel.Text = _cart.DiscountTotal.ToString();
        this.totalShippingLabel.Text = _cart.ShippingTotal.ToString();
        this.totalTaxLabel.Text = _cart.TaxesTotal.ToString();
        this.totalLabel.Text = _cart.Total.ToString();
    }
}
